package com.geekchique.runningbuddy.view;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.geekchique.runningbuddy.activity.PastJogs;
import com.geekchique.runningbuddy.model.ListOfJogs;

public class TodayView extends LinearLayout{

	private TextView distance;
	private TextView heading_jogname;
	private TextView timerun;
	private Activity activity;

	public TodayView(Activity activity, Button goToPastJogs, TextView distance, TextView timerun, ListOfJogs allJogsRanToday){
		super(activity);

		this.activity = activity;
        this.setOrientation(VERTICAL);
		this.distance = distance;
		this.timerun = timerun;

		goToPastJogs.setOnClickListener(goToPastJogsClicked);


        distance.setText("00 miles");
        addView(timerun, new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

        timerun.setText(allJogsRanToday.getTotalJoggingTime());
        addView(distance, new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

	}


   private OnClickListener goToPastJogsClicked = new OnClickListener()
    {
    	public void onClick(View v)
    	{
    		Intent pastJogsActivity = new Intent(activity, PastJogs.class);
    		activity.startActivity(pastJogsActivity);
    	}
    };


	public TextView getMiles() {
		return distance;
	}

	public void setMiles(String text) {
		this.distance.setText(text);
	}

	public TextView getHeading_jogname() {
		return heading_jogname;
	}

	public void setHeading_jogname(String text) {
		this.heading_jogname.setText(text);
	}

	public TextView getTimerun() {
		return timerun;
	}

	public void setTimerun(String text) {
		this.timerun.setText(text);
	}

}








